/*
 * @Author: szx
 * @Date: 2022-02-27 12:46:41
 * @LastEditTime: 2022-02-27 12:51:22
 * @Description:
 * @FilePath: \leetcode\500-599\553\553.js
 */
/**
 * @param {number[]} nums
 * @return {string}
 */
var optimalDivision = function (nums) {
    if (nums.length == 1) return nums[0].toString();
    if (nums.length == 2) return nums.join('/');
    nums[1] = '(' + nums[1];
    nums[nums.length - 1] = nums[nums.length - 1] + ')';
    return nums.join('/');
};
